package com.gxh.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.gxh.annotation.AutoFill;
import com.gxh.dto.CategoryPageQueryDTO;
import com.gxh.entity.Category;
import com.gxh.enumeration.OperationType;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

/**
* @author 29765
* @description 针对表【category(菜品及套餐分类)】的数据库操作Mapper
* @createDate 2025-05-27 20:03:47
* @Entity com.gxh.entity.Category
*/
@Mapper
public interface CategoryMapper extends BaseMapper<Category> {

    /**
     * 分类分页查询
     * @param categoryPageQueryDTO
     * @return
     */
    Page<Category> pageQuery(CategoryPageQueryDTO categoryPageQueryDTO);

    /**
     * 新增分类
     * @param category
     */
    @Insert("insert into category (name,sort,create_time,update_time,create_user,update_user) " +
            "values (#{name},#{sort},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    @AutoFill(OperationType.INSERT)
    void insertCategory(Category category);

    /**
     * 修改分类
     * @param category
     */
    @AutoFill(OperationType.UPDATE)
    void updateCategory(Category category);
}




